package com.xbongbong.pro.log.pojo.dto;

import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.OperationsPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.pro.form.pojo.RuleTargetPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/11/8 15:09
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class RuleBusinessLogDTO extends BaseDTO {

    private static final long serialVersionUID = -5022555050499529212L;
    /**
     * 目标表单menuId
     */
    private RuleTargetPojo target;

    /**
     * 操作
     */
    private List<OperationsPojo> operations;


    private List<PaasFormDataEntityExt> formDataList;

    private Map<String, FieldAttrEntity> targetExplain;

    private List<UpdateDataEntity> valueList;

    public RuleBusinessLogDTO() {
    }

    public RuleBusinessLogDTO(RuleTargetPojo target, List<OperationsPojo> operations, List<PaasFormDataEntityExt> formDataList, Map<String, FieldAttrEntity> targetExplain,
                              String corpid, UserVO userVO, Integer editFlag, String platform, String httpHeader, String browserInfo, String ip, String locale) {
        this.target = target;
        this.operations = operations;
        this.formDataList = formDataList;
        this.targetExplain = targetExplain;
        setCorpid(corpid);
        setLoginUser(userVO);
        setUserId(userVO.getUserId());
        setLoginUserName(userVO.getName());
        setPlatform(platform);
        setHttpHeader(httpHeader);
        setBrowserInfo(browserInfo);
        setIp(ip);
        setLocale(locale);
    }


    public RuleBusinessLogDTO(String corpid, RuleTargetPojo target, List<PaasFormDataEntityExt> formDataList, Map<String, FieldAttrEntity> targetExplain) {
        setCorpid(corpid);
        this.target = target;
        this.formDataList = formDataList;
        this.targetExplain = targetExplain;
    }
}
